package com.ruoyi.edu.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.edu.mapper.EduSchoolMapper;
import com.ruoyi.edu.domain.EduSchool;
import com.ruoyi.edu.service.IEduSchoolService;

/**
 * 学校信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-29
 */
@Service
public class EduSchoolServiceImpl implements IEduSchoolService 
{
    @Autowired
    private EduSchoolMapper eduSchoolMapper;

    /**
     * 查询学校信息
     * 
     * @param schoolId 学校信息主键
     * @return 学校信息
     */
    @Override
    public EduSchool selectEduSchoolBySchoolId(Long schoolId)
    {
        return eduSchoolMapper.selectEduSchoolBySchoolId(schoolId);
    }

    /**
     * 查询学校信息列表
     * 
     * @param eduSchool 学校信息
     * @return 学校信息
     */
    @Override
    public List<EduSchool> selectEduSchoolList(EduSchool eduSchool)
    {
        return eduSchoolMapper.selectEduSchoolList(eduSchool);
    }

    /**
     * 新增学校信息
     * 
     * @param eduSchool 学校信息
     * @return 结果
     */
    @Override
    public int insertEduSchool(EduSchool eduSchool)
    {
        eduSchool.setCreateTime(DateUtils.getNowDate());
        return eduSchoolMapper.insertEduSchool(eduSchool);
    }

    /**
     * 修改学校信息
     * 
     * @param eduSchool 学校信息
     * @return 结果
     */
    @Override
    public int updateEduSchool(EduSchool eduSchool)
    {
        eduSchool.setUpdateTime(DateUtils.getNowDate());
        return eduSchoolMapper.updateEduSchool(eduSchool);
    }

    /**
     * 批量删除学校信息
     * 
     * @param schoolIds 需要删除的学校信息主键
     * @return 结果
     */
    @Override
    public int deleteEduSchoolBySchoolIds(Long[] schoolIds)
    {
        return eduSchoolMapper.deleteEduSchoolBySchoolIds(schoolIds);
    }

    /**
     * 删除学校信息信息
     * 
     * @param schoolId 学校信息主键
     * @return 结果
     */
    @Override
    public int deleteEduSchoolBySchoolId(Long schoolId)
    {
        return eduSchoolMapper.deleteEduSchoolBySchoolId(schoolId);
    }
}
